home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 1.iso / dist / fw_apache2.idb / usr / freeware / apache2 / sbin / apachectl.z / apachectl
Text File  |  2002-07-08  |  5KB  |  138 lines

  1. #!/bin/sh
  2. #
  3. # Copyright (c) 2000-2002 The Apache Software Foundation.
  4. # See license at the end of this file.
  5. #
  6. # Apache control script designed to allow an easy command line interface
  7. # to controlling Apache.  Written by Marc Slemko, 1997/08/23
  8. # The exit codes returned are:
  9. #   XXX this doc is no longer correct now that the interesting
  10. #   XXX functions are handled by httpd
  11. #    0 - operation completed successfully
  12. #    1 - 
  13. #    2 - usage error
  14. #    3 - httpd could not be started
  15. #    4 - httpd could not be stopped
  16. #    5 - httpd could not be started during a restart
  17. #    6 - httpd could not be restarted during a restart
  18. #    7 - httpd could not be restarted during a graceful restart
  19. #    8 - configuration syntax error
  20. #
  21. # When multiple arguments are given, only the error from the _last_
  22. # one is reported.  Run "apachectl help" for usage info
  23. #
  24. ARGV="$@"
  25. #
  26. # |||||||||||||||||||| START CONFIGURATION SECTION  ||||||||||||||||||||
  27. # --------------------                              --------------------
  28. # the path to your httpd binary, including options if necessary
  29. HTTPD='/usr/freeware/apache2/sbin/httpd'
  30. #
  31. # pick up any necessary environment variables
  32. if test -f /usr/freeware/apache2/bin/envvars; then
  33.   . /usr/freeware/apache2/bin/envvars
  34. fi
  35. #
  36. # a command that outputs a formatted text version of the HTML at the
  37. # url given on the command line.  Designed for lynx, however other
  38. # programs may work.  
  39. LYNX="lynx -dump"
  40. #
  41. # the URL to your server's mod_status status page.  If you do not
  42. # have one, then status and fullstatus will not work.
  43. STATUSURL="http://localhost:8080/server-status"
  44. #
  45. # --------------------                              --------------------
  46. # ||||||||||||||||||||   END CONFIGURATION SECTION  ||||||||||||||||||||
  47.  
  48. ERROR=0
  49. if [ "x$ARGV" = "x" ] ; then 
  50.     ARGV="-h"
  51. fi
  52.  
  53. case $ARGV in
  54. start|stop|restart|graceful)
  55.     $HTTPD -k $ARGV
  56.     ERROR=$?
  57.     ;;
  58. startssl|sslstart|start-SSL)
  59.     $HTTPD -k start -DSSL
  60.     ERROR=$?
  61.     ;;
  62. configtest)
  63.     $HTTPD -t
  64.     ERROR=$?
  65.     ;;
  66. status)
  67.     $LYNX $STATUSURL | awk ' /process$/ { print; exit } { print } '
  68.     ;;
  69. fullstatus)
  70.     $LYNX $STATUSURL
  71.     ;;
  72. *)
  73.     $HTTPD $ARGV
  74.     ERROR=$?
  75. esac
  76.  
  77. exit $ERROR
  78.  
  79. # ====================================================================
  80. # The Apache Software License, Version 1.1
  81. #
  82. # Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
  83. # reserved.
  84. #
  85. # Redistribution and use in source and binary forms, with or without
  86. # modification, are permitted provided that the following conditions
  87. # are met:
  88. #
  89. # 1. Redistributions of source code must retain the above copyright
  90. #    notice, this list of conditions and the following disclaimer.
  91. #
  92. # 2. Redistributions in binary form must reproduce the above copyright
  93. #    notice, this list of conditions and the following disclaimer in
  94. #    the documentation and/or other materials provided with the
  95. #    distribution.
  96. #
  97. # 3. The end-user documentation included with the redistribution,
  98. #    if any, must include the following acknowledgment:
  99. #       "This product includes software developed by the
  100. #        Apache Software Foundation (http://www.apache.org/)."
  101. #    Alternately, this acknowledgment may appear in the software itself,
  102. #    if and wherever such third-party acknowledgments normally appear.
  103. #
  104. # 4. The names "Apache" and "Apache Software Foundation" must
  105. #    not be used to endorse or promote products derived from this
  106. #    software without prior written permission. For written
  107. #    permission, please contact apache@apache.org.
  108. #
  109. # 5. Products derived from this software may not be called "Apache",
  110. #    nor may "Apache" appear in their name, without prior written
  111. #    permission of the Apache Software Foundation.
  112. #
  113. # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  114. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  115. # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  116. # DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  117. # ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  118. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  119. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  120. # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  121. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  122. # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  123. # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  124. # SUCH DAMAGE.
  125. # ====================================================================
  126. #
  127. # This software consists of voluntary contributions made by many
  128. # individuals on behalf of the Apache Software Foundation.  For more
  129. # information on the Apache Software Foundation, please see
  130. # <http://www.apache.org/>.
  131. #
  132. # Portions of this software are based upon public domain software
  133. # originally written at the National Center for Supercomputing Applications,
  134. # University of Illinois, Urbana-Champaign.
  135. #
  136.